<!DOCTYPE html>
<html lang="en">
	<head>
		<meta charset="UTF-8">
		<meta name="viewport" content="width=device-width,initial-scale=1,user-scalable=0">
		<title>信息绑定</title>
		<link rel="stylesheet" href="__PUBLIC__/css/weui.min.css" />
		<link rel="stylesheet" href="__PUBLIC__/css/example.css" />
		<script src="__PUBLIC__/js/zepto.min.js"></script>
		<script src="__PUBLIC__/js/jquery-weui.js"></script>
		<script src="__PUBLIC__/js/jquery.min.js"></script>
		<script src="http://res.wx.qq.com/open/js/jweixin-1.0.0.js"></script>
	</head>

	<body>
		<div class="container">
			<div class="hd">
				<h1 class="page_title">信息绑定申请</h1>
			</div>
			<div class="bd">
				<div class="weui_cells_title">请如实填写个人信息</div>
				<div class="weui_cells weui_cells_form">
					<div class="weui_cell">
						<div class="weui_cell_hd">
							<label class="weui_label">姓名</label>
						</div>
						<div class="weui_cell_bd weui_cell_primary">
							<input class="weui_input" name="name" type="text" maxlength="6" placeholder="请输入姓名" required="required" />
						</div>
					</div>
					<div class="weui_cell">
						<div class="weui_cell_hd">
							<label class="weui_label">手机号</label>
						</div>
						<div class="weui_cell_bd weui_cell_primary">
							<input class="weui_input" name="telphoneNum" type="text" maxlength="11" placeholder="请输入手机号" required="required" />
						</div>
					</div>
					<div class="weui_cell">
						<div class="weui_cell_hd">
							<label class="weui_label">邮箱</label>
						</div>
						<div class="weui_cell_bd weui_cell_primary">
							<input class="weui_input" name="email" type="email" placeholder="请输入常用邮箱" required="required" />
						</div>
					</div>
				</div>

				<div class="weui_cells_title">以下信息是选填</div>
				<div class="weui_cells weui_cells_form">
					<div class="weui_cell">
						<div class="weui_cell_hd">
							<label class="weui_label">短号</label>
						</div>
						<div class="weui_cell_bd weui_cell_primary">
							<input class="weui_input" name="telphoneShortNum" type="text" maxlength="6" placeholder="请输入手机短号" />
						</div>
					</div>
					<div class="weui_cell">
						<div class="weui_cell_hd">
							<label class="weui_label">QQ</label>
						</div>
						<div class="weui_cell_bd weui_cell_primary">
							<input class="weui_input" name="qq" type="text" maxlength="10" placeholder="请输qq号" />
						</div>
					</div>
				</div>

				<div class="weui_btn_area">
					<input class="weui_btn weui_btn_primary" id="submit" type="submit" value="申请" />
				</div>
			</div>
		</div>
		<div class="weui_msg" style="display: none;">
			<div class="weui_icon_area do_success"><i class="weui_icon_success weui_icon_msg"></i></div>
			<div class="weui_icon_area do_failure" style="display: none;"><i class="weui_icon_warn weui_icon_msg"></i></div>
			<div class="weui_text_area">
				<h2 class="weui_msg_title do_success">操作成功</h2>
				<h2 class="weui_msg_title do_failure" style="display: none;">操作失败</h2>
				<p class="weui_msg_desc do_failure">请联系平台管理员……</p>
				<p class="weui_msg_desc do_success" style="display: none;">请等待管理元素审核……</p>
			</div>
			<div class="weui_opr_area">
				<p class="weui_btn_area">
					<a href="javascript:;" class="weui_btn weui_btn_primary" id="yes">确定</a>
				</p>
			</div>
			<div class="weui_extra_area">
				<a href="javascript:;">查看详情</a>
			</div>
		</div>
		<script type="text/javascript">
			$("#submit").click(function(event){
				var info = $("input").toArray();
				var name = info[0].value;
				var telphoneNum = info[1].value;
				var email = info[2].value;
				var telphoneShortNum = info[3].value;
				var qq = info[4].value;	
          		//上传数据
    			if(name == "" || telphoneNum == "" || email == "" ){
    				alert('注册信息不能为空');
    				return false;
    			}
    			url = "{:U('Index/handleTeacherInfo')}" ;
    			data = {
    				name:name,
    				telphoneNum:telphoneNum,
    				email:email,
    				telphoneShortNum:telphoneShortNum,
    				qq:qq
    			}
    			$.post(url,data,
    			function(data,states){
    				if(data.status){
    					$('.container').hide();
						$(".weui_msg ").show();
    				}else{
    					$('.container').hide();
    					$(".weui_msg ").show();
    					$(".do_success").hide();
    					$(".do_failure").show();
    				}
    			});
    			
				
			});
			$("#yes").click(function(e) {
				wx.closeWindow();
			});
		</script>
	</body>

</html>